<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        <div class="layui-row">
            <div class="layui-col-xs6">
                <div class="layui-form-item">
                    <label class="layui-form-label">药品名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="drug_name" class="layui-input" lay-verify="required" placeholder="请输入药品名称" value="{$row.drug_name|default=''}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">购药人姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" class="layui-input" lay-verify="required" placeholder="请输入姓名" value="{$row.name|default=''}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">手机号</label>
                    <div class="layui-input-block">
                        <input type="text" name="mobile" class="layui-input" lay-verify="required|phone" placeholder="请输入手机号" value="{$row.mobile|default=''}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">身份证号</label>
                    <div class="layui-input-block">
                        <input type="text" name="id_card" class="layui-input" lay-verify="required|identity" placeholder="请输入身份证号" value="{$row.id_card|default=''}">
                    </div>
                </div>
            </div>
            <div class="layui-col-xs6">
                <div class="layui-form-item">
                    <label class="layui-form-label">购药时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="buy_time" data-date="" data-date-type="datetime" lay-verify="required" class="layui-input"  placeholder="请输入购药时间" value="{$row.buy_time|default=''}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">性别</label>
                    <div class="layui-input-block">
                        <input type="radio" name="sex" value="0" title="男" checked>
                        <input type="radio" name="sex" value="1" title="女">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">购药药店</label>
                    <div class="layui-input-block">
                        <input type="text" name="pharmacy" class="layui-input" lay-verify="required" placeholder="请输入购药药店" value="{$row.pharmacy|default=''}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否有退烧功能</label>
                    <div class="layui-input-block">
                        <input type="radio" name="is_fever" value="0" title="否" {in name="$row.is_fever" value="0"} checked{/in}>
                        <input type="radio" name="is_fever" value="1" title="是" {in name="$row.is_fever" value="1"} checked{/in}>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">现居住地址</label>
            <div class="layui-input-block">
                <textarea name="living" class="layui-textarea" lay-verify="required" placeholder="请输入现居住地址">{$row.living|default=''}</textarea>
            </div>
        </div>
        {if $isSuper}
        <div class="layui-form-item">
            <label class="layui-form-label">居住地所属乡镇</label>
            <div class="layui-input-block">
                <select name="town" id="town" lay-filter="town">
                    {foreach $getTownList as $k=>$v}
                    <option value="{$v.value}" {in name="$row.town" value="$v.value"} selected{/in}>{$v.label}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">居住地所属社区</label>
            <div class="layui-input-block">
                <select name="community" id="community" lay-filter="community"></select>
            </div>
        </div>
        {/if}
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="desc" class="layui-textarea" placeholder="请输入备注">{$row.desc|default=''}</textarea>
            </div>
        </div>
        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>
    </form>
</div>
<script>
    var town = parseInt('{$row.town}')
        ,community = parseInt('{$row.community}');
</script>